<?php
namespace Tbf\Bundle\SerializerBundle\Handler;
use Tbf\Bundle\SerializerBundle\Handler\ToArray\ToArrayInterface;
use Tbf\Bundle\SerializerBundle\Serializer;
use Tbf\Bundle\SerializerBundle\SerializerAware;

class ArrayCollectionSerializer extends SerializerAware implements ToArrayInterface
{
    public function toArray($obj,$group=null)
    {
        $output = array();
        foreach ($obj as $key=>$value) {
            $output[$key] = $this->serializer->toArray($value);
        }

        return $output;
    }
}
